home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19970326-19970626
/
000336_news@newsmaster….columbia.edu _Fri Jun 20 23:14:53 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
6KB
Return-Path: <news@newsmaster.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id XAA16342
for <kermit.misc@watsun.cc.columbia.edu>; Fri, 20 Jun 1997 23:14:52 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id XAA02486
for kermit.misc@watsun; Fri, 20 Jun 1997 23:14:52 -0400 (EDT)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: ShellExecute()
Message-ID: <33aa9b09.2490401@news.opus1.com>
From: hatcher@flash.net (Erik Hatcher)
Date: Fri, 20 Jun 1997 15:04:07 GMT
Reply-To: hatcher@flash.net
References: <33a9fbb4.471671067@news.rochester.ican.net>
Nntp-Posting-Host: ip011.pvsoftware.com
X-Newsreader: Forte Free Agent 1.1/32.230
Lines: 146
Path: news.columbia.edu!panix!howland.erols.net!news.maxwell.syr.edu!news.he.net!gridnntp1!summer.Opus1.COM!opus1.com!opus1.com!nntp
Xref: news.columbia.edu comp.protocols.kermit.misc:7198
Why re-invent the wheel folks???
Win95 and WinNT 4.0 both have a way of doing this without writing a
new program. Its the "start" command.
I tried it by using "start http://www.pvsoftware.com" and it
worked by opening that page in the *already* opened browser (IE 3).
Here's the output of "start /?"...
Starts a separate window to run a specified program or command.
START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME] [/WAIT] [/B]
[command/program] [parameters]
"title" Title to display in window title bar.
path Starting directory
I The new environment will be the original environment
passed
to the cmd.exe and not the current environment.
MIN Start window minimized
MAX Start window maximized
SEPARATE Start 16-bit Windows program in separate memory space
SHARED Start 16-bit Windows program in shared memory space
LOW Start application in the IDLE priority class
NORMAL Start application in the NORMAL priority class
HIGH Start application in the HIGH priority class
REALTIME Start application in the REALTIME priority class
WAIT Start application and wait for it to terminate
B Start application without creating a new window. The
application has ^C handling ignored. Unless the
application
enables ^C processing, ^Break is the only way to
interrupt the
application
command/program
If it is an internal cmd command or a batch file then
the command processor is run with the /K switch to
cmd.exe.
This means that the window will remain after the
command
has been run.
If it is not an internal cmd command or batch file
then
it is a program and will run as either a windowed
application
or a console application.
parameters These are the parameters passed to the command/program
If Command Extensions are enabled, external command invocation
through the command line or the START command changes as follows:
non-executable files may be invoked through their file association
just
by typing the name of the file as a command. (e.g. WORD.DOC
would
launch the application associated with the .DOC file extension).
See the ASSOC and FTYPE commands for how to create these
associations from within a command script.
When executing an application that is a 32-bit GUI application,
CMD.EXE
does not wait for the application to terminate before returning to
the command prompt. This new behavior does NOT occur if executing
within a command script.
When executing a command line whose first token is CMD without an
extension or path qualifier, then replaces CMD with the value of
the
COMSPEC variable, thus avoiding picking up random versions of
CMD.EXE when you least expect them.
When executing a command line whose first token does NOT contain an
extension, then CMD.EXE uses the value of the PATHEXT
environment variable to determine which extensions to look for
and in what order. The default value for the PATHEXT variable
is:
.COM;.EXE;.BAT;.CMD
Notice the syntax is the same as the PATH variable, with
semicolons separating the different elements.
When executing a command, if there is no match on any extension, then
looks to see if the name, without any extension, matches a directory
name
and if it does, the START command launches the Explorer on that path.
If done from the command line, it is the equivalent to doing a CD /D
to that path.
On Fri, 20 Jun 1997 05:01:46 GMT, vefatica@syr.edu (Vincent Fatica)
wrote:
>OK ... so I built this useful little one-liner (on NT 4.0 with
>MSVC++4.0) ...
>
>//SE.CPP
>#include <windows.h>
>HINSTANCE main ( int argc, char * argv[] )
>{return ShellExecute(NULL, "open", argv[1],
> (argc > 2) ? argv[2] : NULL,
> (argc > 3) ? argv[3] : NULL,
> SW_SHOW);
>}
>
>syntax: SE [shell_object] [parameters [working dir]]
>
>(Empty and multiword "parameters" must be "quoted"; likewise
>path\program names containing spaces.)
>
>It can be used as K95's browser (tried it). Also, if you invoke SE
>from the K95 command line (with "run"), since SE itself exits, you can
>return to the K95 prompt while the browser (or whatever) is still
>running. It works here (on NT); no promises intended.
>
>Command line examples:
>
> se http://www.kermit.columbia (netscape, (here))
> se c: (explorer)
> se c:\winnt (explorer)
> se CMD "" c:\winnt (CMD session)
> se CMD "/c file.bat" (run bat & quit)
> se mailto:vefatica@syr.edu (pmail, (here))
> se file.txt (notepad)
> se file.doc (word, (here))
> se ftp://kermit.columbia.edu (netscape)
> se CMD "/k dir /s /p" h:\k95\ (run dir & stay)
> se (starts explorer in root/boot dir (here anyway))
>
>SE should start anything the shell knows how to handle, otherwise,
>fail and return 0. Anyone is welcomed to it. Get it (15872 bytes) at:
>
> ftp://math.syr.edu/pub/vefatica/se.exe
>
> - Vince
>___
> Vincent Fatica
> Syracuse University Mathematics
> vefatica@syr.edu
> http://barnyard.syr.edu/~vefatica/